package utils;

import java.sql.*;

public class mysqlUtil {
    public static Connection getConn() throws ClassNotFoundException, SQLException {
//调用jdbc
        Class.forName("com.mysql.cj.jdbc.Driver");
        //获取连接对象
        String url = "jdbc:mysql:///db_view";
        String user = "root";
        String pwd = "123456";
        Connection connection = DriverManager.getConnection(url, user, pwd);
        return connection;
    }
}
